const IMAGE_URL = import.meta.env.VITE_IMAGE_URL || 'https://api.example.com';
//请求图片
const oss = (url:string) => {
	let image = '';
	//当地址不存在
	if (url) {
		if ((/^data:image\//.test(url)) || url.indexOf('//') == 0) {
			image = url;
		} else if ((/^(http|https):\/\/.+/.test(url))) {
			image = url;
		} else {
			image = IMAGE_URL + url;
		}
	} else {
		image = '/static/img/common/bitmap.png';
	}
	return image;
};
export default {
	oss
}